﻿using System.ComponentModel;

namespace Papa.Common {
    public abstract class NotifiableObject : INotifyPropertyChanged {
        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void RaisePropertyChanged(string propertyName) {
            if (PropertyChanged != null) {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
                //System.Diagnostics.Debug.WriteLine(propertyName);
            }
        }

        protected void RaisePropertyChanged(params string[] propertyNames) {
            foreach (var name in propertyNames) {
                RaisePropertyChanged(name);
            }
        }
    }
}